package edu.fiu.cis.nursing.server;

import java.util.ArrayList;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

import edu.fiu.cis.nursing.client.NursingService;
import edu.fiu.cis.nursing.server.data.DataProvider;
import edu.fiu.cis.nursing.shared.NursingRecord;
import edu.fiu.cis.nursing.shared.Query;
import edu.fiu.cis.nursing.shared.UserToken;

/**
 * The server side implementation of the RPC service.
 */
@SuppressWarnings("serial")
public class NursingServiceImpl extends RemoteServiceServlet implements
		NursingService {

	private NursingService _delegate = new DataProvider();

	public ArrayList<NursingRecord> search(Query query)
			throws IllegalArgumentException {

		return _delegate.search(query);
	}

	@Override
	public NursingRecord load(String id) {
		return _delegate.load(id);
	}

	@Override
	public UserToken validateCookie(String cookie) {
		return null;
	}

	@Override
	public UserToken loginUser(String userId, String password) {
//	    String hashFromDB = /*(obtain hash from user's db entry)*/;
//	    boolean valid = BCrypt.checkpw(password, hashFromDB);
//	    if ( valid ) {
//	    	
//	    }
		return null;
	}
	
	

}
